package com.yc.chaoshi.cs_manage.mapper;

import com.yc.chaoshi.entity.PmsFenlei1;
import com.yc.chaoshi.entity.PmsFenlei2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xz
 * @since 2022-08-04
 */
public interface PmsFenlei2Mapper extends BaseMapper<PmsFenlei2> {

    List<PmsFenlei2> selectfenlei2(@Param("bname")String bname,
                                   @Param("page")int page,
                                   @Param("size") int size);

    @Delete("delete from pms_fenlei2 where bid=#{bid}")
    Long deletefenlei2(@Param("bid") int bid);

    @Insert("insert into pms_fenlei2 values(default,#{aid},#{bname},#{display},#{des})")
    Long insertfenlei2(@Param("bname") String bname,
                       @Param("aid") int aid,
                       @Param("display") int display,
                       @Param("des") String des
    );


    @Update("update pms_fenlei2 set bname=#{bname},aid=#{aid},display=#{display}, des=#{des} where bid=#{bid}")
    Long updatefenlei2(@Param("bname") String bname,
                       @Param("aid")int aid,
                       @Param("display") int display,
                       @Param("des") String des,
                       @Param("bid") int bid);
}
